<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th>编号</th>
			<th>房间号</th>
			<th>姓名</th>
			<th>表类型</th>
			<th>起数</th>
			<th>止数</th>
			<th>费用</th>
			<th>欠费</th>
			<th>抄表日期</th>
			<th>处置</th>
			<th>处置人</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($list) && count($list)){ foreach($list as $k=>$ls){ ?>
			<?php $rowspan = count($ls['list']); foreach($ls['list'] as $kk=>$lls){ ?>
				<tr class="text-c">
				<?php if($kk==0){ ?>
					<td rowspan="{$rowspan}" style="background-color: #ffffff"><?php echo ($page-1)*C('PAGE_SIZE')+($k+1); ?></td>
					<td rowspan="{$rowspan}" style="background-color: #ffffff">{$ls['roomnumber']}</td>
					<td rowspan="{$rowspan}" style="background-color: #ffffff">{$ls['member_nick']}</td>
				<?php } ?>
					<td>{$lls['eqmtitle']}</td>
					<td>{$lls['real_start_number']/10}</td>
					<td>{$lls['last_number']/10}</td>
					<td><?php echo ($lls['last_number'] - $lls['real_start_number'])/10 * $lls['rates']; ?></td>
					<td>-{$lls['balance']}</td>
					<td><?php echo date('Y-m-d H:i', $lls['updatetime']); ?></td>
					<td id="st_{$lls['eqment_id']}"><?php echo !$lls['state'] ? '停止' : '启用'; ?></td>
					<td>{$lls['user_nick']}</td>
					<!--<td><?php echo $lls['stoptime'] ? date('Y-m-d H:i') : '---'; ?></td>-->
					<td>
						<a href="javascript:void(0);" class="act" vl="1" ids="{$lls['eqment_id']}">启用</a> |
						<a href="javascript:void(0);" class="act" vl="0" ids="{$lls['eqment_id']}">停用</a> |
						<a href="javascript:void(0);" class="acts" vl="2" ids="{$lls['eqment_id']}">短信通知</a>
					</td>
				</td>
			<?php } ?>
		<?php }}else{ ?>
		<tr class="text-c">
			<td colspan="14">暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<!--page-->
<include file="Common/page" />
<script>
	$(document).ready(function(){
		//修改状态
		$(".act").on('click', function(){
			var obj = $(this);
			var	status = obj.attr('vl');
			var	id = obj.attr('ids');
			$.post('eqment/setstatus.html', {id: id, status: status}, function(data){
				if(data/1){
					var shtml = status/1 == 1 ? '启用' : '停用';
					$("#st_"+ id).html(shtml);
				}
			});
		});
	});
</script>